-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify real expression in U{FreeIdent,Repeated}Test
#32
Unify real expression in U{FreeIdent,Repeated}Test
#32
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some context.
} | ||
|
||
@BugPattern( | ||
name = "UnificationChecker", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After merging the PR, we can rebase it and also drop the name
field here and below.
45120d2
to
20508e2
Compare
@Stephan202 , do you have time for a last pass? (We already discussed this twice offline 😄, I think it is good to go) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for my tardiness; added a commit :)
Unifier unifier = new Unifier(new Context()); | ||
UFreeIdent ident = UFreeIdent.create("foo"); | ||
|
||
assertThat(ident.unify(tree.getExpression(), unifier)).isNotNull(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can avoid the .getExpression()
calls if we use a MethodInvocationTreeMatcher
instead.
❗ This PR is on top of #4 ❗
In #4 we introduce additional logic to filter out invalid expressions in
UFreeIdent
, see here.However, when this code got introduced in this commit c2e14f2, it broke our code.
The test cases in the
UFreeIdentTest
andURepeatedTest
are not "valid"/"realistic" enough and therefore results in anIllegalArgumentException
inASTHelpers#getSymbol(MethodInvocationTree)
.To make our code compatible with this change, we changed the tests to use
BugChecker
s for the two tests. This way we can use the same assertions but use real expressions that are accepted byASTHelpers#getSymbol
.Once we merge this PR we can also rebase #4 with
master
.